Repository navigation
Conversation
|
Controlled fault replay: identical test source, base a88f255 plus the new assertion exits 1 specifically on the refused save joining the pending decode; head dd543aa exits 0 with byte-identical resident continuations. Windows CPU Qwen2.5-0.5B Q4_K_M, two threads. Accepted-move control, alternating base/head/head/base, 128-token prompt, 1.6 MB state: base save 0.62–0.64 ms/load 0.15 ms, head save 0.62–0.76 ms/load 0.14–0.15 ms. Sampled peak working set approximately 509 MB; both following tokens byte-identical on every run. The demonstrated benefit is the avoided join on refusal. GPU concurrency and production throughput remain unmeasured. |
joelteply
left a comment
There was a problem hiding this comment.
Fable review at dd543aa: approve the change.
Claim verified by reading the head:
persona_check_save(src/llama-kv-cache.cpp:1286) andpersona_check_load(:1342) are const. They read only host cell metadata (v_cells[..].used_max_p1(),get_used(),seq_pos_max), which a decode updates when it is submitted, so they are valid while that decode is still queued. Save's check sizes only the caller's host vectors.- Both commits still
synchronize()beforeggml_backend_tensor_get/tensor_seton the stream's rows (llama-context.cpp persona_save / persona_load), so an accepted move still fences. - The regression is real:
n_p_evalonly moves insidellama_context::synchronize()(llama-context.cpp:728-746, fromn_queued_tokens), andf.promptdecodes without reading logits. An equal counter across the refused save proves the refusal did not synchronize.
Not verified: I did not run it. Your Windows CPU receipts are the run.
Non-blocking: nothing here asserts the accepted path still fences. The byte-identical continuations cover it indirectly; a later card could pin it the same way (the counter moves across an accepted save).
🤖 Generated with Claude Code
Stacked on #147. Move the context synchronization to the accepted commit boundary for native save and load. The validation phase checks host metadata and prepares destination storage. A refusal can now return while decode remains queued. Accepted transfers still synchronize before accessing device rows. This is a narrow fault-path change. Dynamic stream growth and overlapped successful transfers remain open.
Windows MSVC static Release, CPU, two threads: test-persona-blocks passed on Qwen2.5-0.5B Q4_K_M and Qwen3.5-0.8B Q8_0 hybrid. Both resident continuations were byte-identical. The regression assertion compares completed prompt tokens across a refused save while decode is queued. No production timing claim.